﻿@{Layout = "~/Views/Shared/_Layout.cshtml";}
<h1>Add User</h1>
@{
    if (ViewData.Model != null)
    {
        if (ViewData.Model.GetType() == typeof(string))
        {
            <div class='Error'>@ViewData.Model</div>
        }
    }
}
<form method="post">
    <table class="Form">
        <tr>
            <th>User Initials*</th>
            <td><input type="text" name="inId" value="@ViewData["inId"]" /></td>
        </tr>
        <tr>
            <th>First Name*</th>
            <td><input type="text" name="inFirstName" value="@ViewData["inFirstName"]" /></td>
        </tr>
        <tr>
            <th>Last Name*</th>
            <td><input type="text" name="inLastName" value="@ViewData["inLastName"]" /></td>
        </tr>
        <tr>
            <th>Password*</th>
            <td><input type="password" name="inPasswd1"/></td>
        </tr>
        <tr>
            <th>Confirm Password*</th>
            <td><input type="password" name="inPasswd2"/></td>
        </tr>
        <tr>
            <th>User group</th>
            <td>@Html.DropDownList("inGroup", Scheduling.Models.Helpers.SchedulingHelper.GenerateUserGroupList(), new { Size = "1" })</td>
        </tr>
        <tr>
            <th>Department</th>
            <td>@Html.DropDownList("inDepartment", Scheduling.Models.Helpers.SchedulingHelper.GenerateDepartmentList(), new { Size = "1"})</td>
        </tr>
        <tr>
            <th>E-mail*</th>
            <td><input type="text" name="inEmail" value="@ViewData["inEmail"]" /></td>
        </tr>
        <tr>
            <th>Phone</th>
            <td><input type="text" name="inPhone" value="@ViewData["inPhone"]" /></td>
        </tr>
      </table>
    <input class="Button" type="submit" value="Add user" />
    <p><i> Fields marked with * are mandatory </i></p>
</form><br />
@Html.ActionLink("Back", "List")

